﻿<Application x:Class="OrzRefectorMenu.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              StartupUri="Template\ClassTemplate.xaml">
    <Application.Resources>

            <ResourceDictionary>
                <!-- Load this specific theme because the Aero theme for CheckBox has issues. -->
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="/PresentationFramework.Luna, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35;component/themes/luna.metallic.xaml"/>
                </ResourceDictionary.MergedDictionaries>

                <Style x:Key="ButtonFocusVisual">
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle SnapsToDevicePixels="true" Margin="2" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

                <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#F3F3F3" Offset="0"/>
                    <GradientStop Color="#EBEBEB" Offset="0.5"/>
                    <GradientStop Color="#DDDDDD" Offset="0.5"/>
                    <GradientStop Color="#CDCDCD" Offset="1"/>
                </LinearGradientBrush>
                <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>

   

                <Style x:Key="UserControlOverlayRectangleStyle" TargetType="{x:Type Rectangle}">
                    <Setter Property="Fill" Value="#FF151515"/>
                    <Setter Property="Opacity" Value="0.61"/>
                </Style>

                <!-- Expendar -->
                <LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
                    <GradientBrush.GradientStops>
                        <GradientStopCollection>
                            <GradientStop Color="#BFD4ED" Offset="0.0"/>
                            <GradientStop Color="#BFD4ED" Offset="1.0"/>
                        </GradientStopCollection>
                    </GradientBrush.GradientStops>
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="HorizontalNormalBrush" StartPoint="0,0" EndPoint="1,0">
                    <GradientBrush.GradientStops>
                        <GradientStopCollection>
                            <GradientStop Color="#BFD4ED" Offset="0.0"/>
                            <GradientStop Color="#BFD4ED" Offset="1.0"/>
                        </GradientStopCollection>
                    </GradientBrush.GradientStops>
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
                    <GradientBrush.GradientStops >
                        <GradientStopCollection>
                            <GradientStop Color="#BFD4ED" Offset ="0.5" />
                            <GradientStop Color="#BFD4ED" Offset="2.5"/>
                        </GradientStopCollection >
                    </GradientBrush.GradientStops>
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
                    <GradientBrush.GradientStops>
                        <GradientStopCollection >
                            <GradientStop Color="#FFF" Offset="0.0"/>
                            <GradientStop Color="#EEE" Offset ="1.0"/>
                        </GradientStopCollection >
                    </GradientBrush.GradientStops >
                </LinearGradientBrush >

                <LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
                    <GradientBrush.GradientStops >
                        <GradientStopCollection >
                            <GradientStop Color="#FFF" Offset ="0.0"/>
                            <GradientStop Color="#AAA" Offset ="1.0"/>
                        </GradientStopCollection >
                    </GradientBrush.GradientStops>
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint ="0,1">
                    <GradientBrush.GradientStops>
                        <GradientStopCollection>
                            <GradientStop Color="#BBB" Offset="0.0"/>
                            <GradientStop Color="#EEE" Offset="0.1"/>
                            <GradientStop Color="#EEE" Offset="0.9"/>
                            <GradientStop Color="#FFF" Offset="1.0"/>
                        </GradientStopCollection>
                    </GradientBrush.GradientStops>
                </LinearGradientBrush>
                <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
                <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
                <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
                <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#DDD" />
                <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
                    <GradientBrush.GradientStops >
                        <GradientStopCollection >
                            <GradientStop Color="LightGray" Offset ="0.0"/>
                            <GradientStop Color="LightGray" Offset ="1.0"/>
                        </GradientStopCollection>
                    </GradientBrush.GradientStops >
                </LinearGradientBrush >

                <LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint ="1,0">
                    <GradientBrush.GradientStops >
                        <GradientStopCollection >
                            <GradientStop Color="#CCC" Offset ="0.0"/>
                            <GradientStop Color="#444" Offset="1.0"/>
                        </GradientStopCollection >
                    </GradientBrush.GradientStops >
                </LinearGradientBrush >
                <LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint ="0,1">
                    <GradientBrush.GradientStops >
                        <GradientStopCollection >
                            <GradientStop Color="#BFDBFF" Offset ="0.0"/>
                            <GradientStop Color="#BFDBFF" Offset ="1.0"/>
                        </GradientStopCollection >
                    </GradientBrush.GradientStops >
                </LinearGradientBrush >

                <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint ="0,1">
                    <GradientBrush.GradientStops>
                        <GradientStopCollection >
                            <GradientStop Color="#BFDBFF" Offset ="0.0"/>
                            <GradientStop Color="#BFDBFF" Offset ="1.0"/>
                        </GradientStopCollection >
                    </GradientBrush.GradientStops >
                </LinearGradientBrush >
                <SolidColorBrush x:Key="DisabledBorderBrush" Color ="#AAA" />
                <SolidColorBrush x:Key="SolidBorderBrush" Color ="#888" />
                <SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />
                <SolidColorBrush x:Key="GlyphBrush" Color ="#444" />
                <SolidColorBrush x:Key="LightColorBrush" Color="#DDD" />
                <ControlTemplate x:Key="ExpanderToggleButton" TargetType ="ToggleButton">
                    <Border Name="Border"  CornerRadius ="2,0,0,0" Background ="Transparent"
                    BorderBrush="{StaticResource NormalBorderBrush}"
                    BorderThickness ="0,0,1,0">
                        <Path Name ="Arrow" Fill="{StaticResource GlyphBrush }"
                      HorizontalAlignment ="Center"
                      VerticalAlignment ="Center"
                      Data ="M 0 0 L 4 4 L 8 0 Z"/>
                    </Border >

                    <ControlTemplate.Triggers >
                        <Trigger Property="ToggleButton.IsMouseOver" Value ="true">
                            <Setter TargetName="Border" Property ="Background"
                            Value="{StaticResource DarkBrush}" />
                        </Trigger >

                        <Trigger Property="IsPressed" Value ="true">
                            <Setter TargetName="Border" Property ="Background"
                            Value="{StaticResource PressedBrush }" />
                        </Trigger >

                        <Trigger Property="IsChecked" Value ="true">
                            <Setter TargetName="Arrow" Property ="Data"
                            Value ="M 0 4 L 4 0 L 8 4 Z" />
                        </Trigger >

                        <Trigger Property="IsEnabled" Value ="False">
                            <Setter TargetName="Border" Property="Background"
                            Value="{StaticResource DisabledBackgroundBrush }" />
                            <Setter TargetName="Border" Property ="BorderBrush"
                            Value="{StaticResource DisabledBorderBrush }" />
                            <Setter Property ="Foreground"
                            Value="{StaticResource DisabledForegroundBrush }"/>
                            <Setter TargetName="Arrow" Property ="Fill"
                            Value="{StaticResource DisabledForegroundBrush }" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
                <Style x:Key="expander" TargetType ="Expander">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType ="Expander">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height ="Auto"/>
                                        <RowDefinition Name="ContentRow" Height ="0"/>
                                    </Grid.RowDefinitions>
                                    <Border Name="Border"  Grid.Row="0"  Background="{StaticResource LightBrush }" BorderBrush="{StaticResource NormalBorderBrush}" BorderThickness="1"  CornerRadius ="2,2,0,0" >
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width ="20" />
                                                <ColumnDefinition Width ="*" />
                                            </Grid.ColumnDefinitions >
                                            <ToggleButton IsChecked="{Binding Path=IsExpanded,Mode =TwoWay, RelativeSource={RelativeSource TemplatedParent }}" OverridesDefaultStyle="True"  Template="{StaticResource ExpanderToggleButton}"
                                                  Background="{StaticResource NormalBrush}" />
                                            <ContentPresenter  Grid.Column="1" Margin="4" ContentSource="Header" TextElement.Foreground="#474747" TextElement.FontWeight ="Bold" RecognizesAccessKey="True" />
                                        </Grid >
                                    </Border>
                                    <Border  Name="Content"  Grid.Row="1"  Background="{StaticResource WindowBackgroundBrush }"
                                     BorderBrush="{StaticResource NormalBorderBrush}"  BorderThickness="1,0,1,1"  CornerRadius ="0,0,2,2" >
                                        <ContentPresenter Margin ="4" />
                                    </Border >
                                </Grid >
                                <ControlTemplate.Triggers >
                                    <Trigger Property="IsExpanded" Value ="True">
                                        <Setter TargetName="ContentRow" Property ="Height"
                                        Value="{Binding ElementName=Content,Path =DesiredHeight}" />
                                    </Trigger>
                                    <Trigger Property="IsEnabled" Value ="False">
                                        <Setter TargetName="Border" Property ="Background"
                                        Value="{StaticResource DisabledBackgroundBrush}" />
                                        <Setter TargetName="Border" Property ="BorderBrush"
                                        Value="{StaticResource DisabledBorderBrush }" />
                                        <Setter Property ="Foreground" Value="{StaticResource DisabledForegroundBrush }"/>
                                    </Trigger >
                                </ControlTemplate.Triggers >
                            </ControlTemplate >
                        </Setter.Value >
                    </Setter>
                </Style >

                <!-- END expendar -->

                <!-- Tab TabItem ControlTemplates -->
                <!-- Application Brushes -->
                <SolidColorBrush x:Key="Brush_TextForeground" Color="Black" />

                <SolidColorBrush x:Key="Brush_MenuTopLevelTextForeground" Color="Black" />

                <SolidColorBrush x:Key="Brush_FormHeadingText" Color="#FF003987" />

                <SolidColorBrush x:Key="Brush_FormSubHeadingText" Color="#FF003987" />

                <LinearGradientBrush x:Key="Brush_BrightBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFBFDBFF" Offset="0" />
                    <GradientStop Color="#FFBFDBFF" Offset="1" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_DarkBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FF6591CD" Offset="0" />
                    <GradientStop Color="#FF6591CD" Offset="1" />
                </LinearGradientBrush>

                <!-- This is used for the text above the mouse over popup tooltips  -->
                <LinearGradientBrush x:Key="Brush_WindowPreviewTitleBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#F3F3F3" Offset="0" />
                    <GradientStop Color="#EBEBEB" Offset="0.5" />
                    <GradientStop Color="#DDDDDD" Offset="0.5" />
                    <GradientStop Color="#CDCDCD" Offset="1" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_LightTabItemBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFE3EFFF" Offset="0" />
                    <GradientStop Color="#FFE3EFFF" Offset="1" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_WindowBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFBFDBFF" Offset="0" />
                    <GradientStop Color="#FFD7E8FF" Offset="1" />
                    <GradientStop Color="#FFD7E8FF" Offset="0.105" />
                    <GradientStop Color="#FFBFDBFF" Offset="0.07" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_TabItemBackgroundBorder" EndPoint="0.5,-0.175" StartPoint="0.5,1.175">
                    <GradientStop Color="#FF6591CD" Offset="0.445" />
                    <GradientStop Color="#FFBFDBFF" Offset="0.855" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_TabItemSelected" EndPoint="0.497,0.076" StartPoint="0.497,1.015">
                    <GradientStop Color="#FFE3EFFF" Offset="0" />
                    <GradientStop Color="#FFE3EFFF" Offset="0.375" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_TabItemNotSelected" EndPoint="0.5,-0.175" StartPoint="0.5,1.175">
                    <GradientStop Color="#FFFFFFFF" Offset="0.683" />
                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                </LinearGradientBrush>

                <SolidColorBrush x:Key="Brush_TabControlNormalBorderBrush" Color="#8C8E94" />

                <LinearGradientBrush x:Key="Brush_TabControlButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#F3F3F3" Offset="0" />
                    <GradientStop Color="#EBEBEB" Offset="0.5" />
                    <GradientStop Color="#DDDDDD" Offset="0.5" />
                    <GradientStop Color="#CDCDCD" Offset="1" />
                </LinearGradientBrush>

                <SolidColorBrush x:Key="Brush_TabItemDisabledBackground" Color="#F4F4F4" />

                <SolidColorBrush x:Key="Brush_TabItemDisabledBorderBrush" Color="#FFC9C7BA" />

                <LinearGradientBrush x:Key="Brush_ToolBarOverflowRegion" EndPoint="0.5,-0.175" StartPoint="0.5,1.175">
                    <GradientStop Color="#FF74A2E2" Offset="0.445" />
                    <GradientStop Color="#FFBFDBFF" Offset="0.83" />
                    <GradientStop Color="#FF74A2E2" Offset="1" />
                </LinearGradientBrush>

                <SolidColorBrush x:Key="Brush_ToolBarButtonBorder" Color="#FFFB8C3C" />

                <LinearGradientBrush x:Key="Brush_ToolBarBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFBFDBFF" Offset="0" />
                    <GradientStop Color="#FFE7F3FF" Offset="0.11" />
                    <GradientStop Color="#FFBFDBFF" Offset="0.53" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_ToolBarMouseOverBackground" EndPoint="0,1" StartPoint="0,0" SpreadMethod="Reflect">
                    <GradientStop Color="#FFFFF5CB" Offset="0.2" />
                    <GradientStop Color="#FFFFE290" Offset="0.6" />
                    <GradientStop Color="#FFFFDB76" Offset="1" />
                    <GradientStop Color="#FFFFF8D5" Offset="0" />
                </LinearGradientBrush>

                <SolidColorBrush x:Key="Brush_ToolBarMouseOverForeground" Color="Black" />

                <LinearGradientBrush x:Key="Brush_ToolBarButtonPressed" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFFB923C" Offset="0" />
                    <GradientStop Color="#FFFC953C" Offset="0.0967741935483871" />
                    <GradientStop Color="#FFFD9D3D" Offset="0.303" />
                    <GradientStop Color="#FFFFAB3F" Offset="0.551" />
                    <GradientStop Color="#FFFFB14D" Offset="0.788" />
                    <GradientStop Color="#FFFFB85D" Offset="1" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_ToolBarHorizontalBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFFFFF" Offset="0" />
                    <GradientStop Color="#FFFBFF" Offset="0.5" />
                    <GradientStop Color="#F7F7F7" Offset="1" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_ToolBarToggleButtonHorizontalBackground" EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#ECECEC" Offset="0" />
                    <GradientStop Color="#DDDDDD" Offset="0.5" />
                    <GradientStop Color="#A0A0A0" Offset="1" />
                </LinearGradientBrush>

                <SolidColorBrush x:Key="Brush_ToolBarGripper" Color="#C6C3C6" />

                <SolidColorBrush x:Key="Brush_ToolBarSubMenuBackground" Color="#FDFDFD" />

                <SolidColorBrush x:Key="Brush_ToolBarMenuBorder" Color="#808080" />

                <LinearGradientBrush x:Key="Brush_ToolBarToggleButtonVerticalBackground" EndPoint="1,0" StartPoint="0,0">
                    <GradientStop Color="#ECECEC" Offset="0" />
                    <GradientStop Color="#DDDDDD" Offset="0.5" />
                    <GradientStop Color="#A0A0A0" Offset="1" />
                </LinearGradientBrush>

                <LinearGradientBrush x:Key="Brush_ToolBarVerticalBackground" EndPoint="1,0" StartPoint="0,0">
                    <GradientStop Color="#FFFFFF" Offset="0" />
                    <GradientStop Color="#FFFBFF" Offset="0.5" />
                    <GradientStop Color="#F7F7F7" Offset="1" />
                </LinearGradientBrush>
                <Style x:Key="TabItemFocusVisual">
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="3,3,3,1" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

                <Style x:Key="TabItemStyle_Application" TargetType="{x:Type TabItem}">
                    <Setter Property="Background" Value="{StaticResource Brush_ToolBarBackground}" />
                    <Setter Property="Foreground" Value="{StaticResource Brush_FormHeadingText}" />
                    <Setter Property="FocusVisualStyle" Value="{StaticResource TabItemFocusVisual}" />
                    <Setter Property="Padding" Value="6,1,6,1" />
                    <Setter Property="BorderBrush" Value="{StaticResource Brush_TabControlNormalBorderBrush}" />
                    <Setter Property="Background" Value="{StaticResource Brush_TabControlButtonNormalBackground}" />
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    <Setter Property="VerticalContentAlignment" Value="Stretch" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type TabItem}">
                                <Grid SnapsToDevicePixels="true">
                                    <Border x:Name="Bd" Padding="{TemplateBinding Padding}" Background="{StaticResource Brush_TabItemNotSelected}" BorderBrush="{DynamicResource Brush_DarkBackground}">
                                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" x:Name="Content" VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" ContentSource="Header" RecognizesAccessKey="True" />
                                    </Border>
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsSelected" Value="true">
                                        <Setter Property="Panel.ZIndex" Value="1" />
                                        <Setter Property="Background" TargetName="Bd" Value="{StaticResource Brush_TabItemSelected}" />
                                        <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Brush_DarkBackground}" />
                                    </Trigger>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="MinWidth" Value="0" SourceName="Bd" />
                                            <Condition Property="IsMouseOver" Value="true" SourceName="Bd" />
                                        </MultiTrigger.Conditions>
                                        <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Brush_ToolBarButtonBorder}" />
                                        <Setter Property="Background" TargetName="Bd" Value="{StaticResource Brush_TabItemSelected}" />
                                    </MultiTrigger>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="IsSelected" Value="false" />
                                            <Condition Property="IsMouseOver" Value="true" />
                                        </MultiTrigger.Conditions>
                                        <Setter Property="Background" TargetName="Bd" Value="{StaticResource Brush_ToolBarMouseOverBackground}" />
                                        <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Brush_ToolBarButtonBorder}" />
                                    </MultiTrigger>
                                    <Trigger Property="TabStripPlacement" Value="Top">
                                        <Setter Property="CornerRadius" TargetName="Bd" Value="6,6,0,0" />
                                    </Trigger>
                                    <Trigger Property="TabStripPlacement" Value="Bottom">
                                        <Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1" />
                                        <Setter Property="CornerRadius" TargetName="Bd" Value="0,0,6,6" />
                                    </Trigger>
                                    <Trigger Property="TabStripPlacement" Value="Left">
                                        <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,0,1" />
                                    </Trigger>
                                    <Trigger Property="TabStripPlacement" Value="Right">
                                        <Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1" />
                                    </Trigger>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="IsSelected" Value="true" />
                                            <Condition Property="TabStripPlacement" Value="Top" />
                                        </MultiTrigger.Conditions>
                                        <Setter Property="Margin" Value="0,-2,-2,-1" />
                                        <Setter Property="Margin" TargetName="Content" Value="0,0,0,1" />
                                    </MultiTrigger>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="IsSelected" Value="true" />
                                            <Condition Property="TabStripPlacement" Value="Bottom" />
                                        </MultiTrigger.Conditions>
                                        <Setter Property="Margin" Value="0,-1,-2,-2" />
                                        <Setter Property="Margin" TargetName="Content" Value="0,1,0,0" />
                                        <Setter Property="Margin" TargetName="Bd" Value="-0.309,0,0.309,0" />
                                    </MultiTrigger>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="IsSelected" Value="true" />
                                            <Condition Property="TabStripPlacement" Value="Left" />
                                        </MultiTrigger.Conditions>
                                        <Setter Property="Margin" Value="-2,-2,-1,-2" />
                                        <Setter Property="Margin" TargetName="Content" Value="0,0,1,0" />
                                    </MultiTrigger>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="IsSelected" Value="true" />
                                            <Condition Property="TabStripPlacement" Value="Right" />
                                        </MultiTrigger.Conditions>
                                        <Setter Property="Margin" Value="-1,-2,-2,-2" />
                                        <Setter Property="Margin" TargetName="Content" Value="1,0,0,0" />
                                    </MultiTrigger>
                                    <Trigger Property="IsEnabled" Value="false">
                                        <Setter Property="Background" TargetName="Bd" Value="{StaticResource Brush_TabItemDisabledBackground}" />
                                        <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Brush_TabItemDisabledBorderBrush}" />
                                        <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

                <Style x:Key="TabControlStyle_Application" TargetType="{x:Type TabControl}">
                    <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.ControlTextBrushKey}}" />
                    <Setter Property="Padding" Value="4" />
                    <Setter Property="BorderThickness" Value="1" />
                    <Setter Property="BorderBrush" Value="{DynamicResource Brush_TabControlNormalBorderBrush}" />
                    <Setter Property="Background" Value="{x:Null}" />
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                    <Setter Property="VerticalContentAlignment" Value="Center" />
                    <Setter Property="Padding" Value="0,0,0,0" />
                    <Setter Property="VerticalContentAlignment" Value="Stretch" />
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    <Setter Property="Margin" Value="0,0,0,0" />
                    <Setter Property="TabStripPlacement" Value="Bottom" />
                    <Setter Property="IsSynchronizedWithCurrentItem" Value="True" />
                    <Setter Property="Height" Value="Auto" />
                    <Setter Property="Width" Value="Auto" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type TabControl}">
                                <Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition x:Name="ColumnDefinition0" />
                                        <ColumnDefinition Width="0" x:Name="ColumnDefinition1" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition x:Name="RowDefinition0" Height="Auto" />
                                        <RowDefinition x:Name="RowDefinition1" Height="*" />
                                    </Grid.RowDefinitions>
                                    <Border x:Name="ContentPanel" Background="{TemplateBinding Background}" BorderBrush="{DynamicResource Brush_DarkBackground}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" Grid.Row="1" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
                                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" />
                                    </Border>
                                    <Border x:Name="HeaderPanelBorder" Margin="0,0,0,0" BorderBrush="{DynamicResource Brush_DarkBackground}" Grid.Column="0" Grid.Row="0" BorderThickness="1,0,1,0" Padding="4,0,4,0">
                                        <TabPanel x:Name="HeaderPanel" IsItemsHost="true" Panel.ZIndex="1" KeyboardNavigation.TabIndex="1" Margin="0,4,0,0" />
                                    </Border>
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="TabStripPlacement" Value="Bottom">
                                        <Setter Property="Grid.Row" TargetName="HeaderPanelBorder" Value="1" />
                                        <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                                        <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                                        <Setter Property="Height" TargetName="RowDefinition1" Value="Auto" />
                                        <Setter Property="Margin" TargetName="HeaderPanel" Value="0,0,0,4" />
                                    </Trigger>
                                    <Trigger Property="TabStripPlacement" Value="Left">
                                        <Setter Property="Grid.Row" TargetName="HeaderPanelBorder" Value="0" />
                                        <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                                        <Setter Property="Grid.Column" TargetName="HeaderPanelBorder" Value="0" />
                                        <Setter Property="Grid.Column" TargetName="ContentPanel" Value="1" />
                                        <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto" />
                                        <Setter Property="Width" TargetName="ColumnDefinition1" Value="*" />
                                        <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                                        <Setter Property="Height" TargetName="RowDefinition1" Value="0" />
                                        <Setter Property="Margin" TargetName="HeaderPanelBorder" Value="2,2,0,2" />
                                    </Trigger>
                                    <Trigger Property="TabStripPlacement" Value="Right">
                                        <Setter Property="Grid.Row" TargetName="HeaderPanelBorder" Value="0" />
                                        <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                                        <Setter Property="Grid.Column" TargetName="HeaderPanelBorder" Value="1" />
                                        <Setter Property="Grid.Column" TargetName="ContentPanel" Value="0" />
                                        <Setter Property="Width" TargetName="ColumnDefinition0" Value="*" />
                                        <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto" />
                                        <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                                        <Setter Property="Height" TargetName="RowDefinition1" Value="0" />
                                        <Setter Property="Margin" TargetName="HeaderPanelBorder" Value="0,2,2,2" />
                                    </Trigger>
                                    <Trigger Property="IsEnabled" Value="false">
                                        <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ResourceDictionary>
        </Application.Resources>
</Application>
